<?php
/*
 * 获取用户头像
 */
 namespace Api\Controller;
 use Think\Controller;
 class AvatrController extends Controller{
 	public function index (){
		$id = I('uid');
		$size = I('size') ? I('size') :200; 
		if(!$id){
			echo "nouid";
			exit;
		}
		$userInfo = D('Admin')->getUserById($id);
//		print_r($userInfo);
		if($userInfo['head_img']){
	        
	        $avatar_url = $userInfo['head_img'];
	        header('Location: ' . $avatar_url .'-head'.$size);
		}else{
			echo 'noimg';
		}
	}
 	
 }